<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'insert.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">

function xiugai(){
	var v1 = document.getElementById("a1").value;
	
	if(v1==''||v1==null){
	alert('用户名不能为空！');
	return false;
	}
	 var age = document.getElementById("gg").value;
	var regAge = /^\d{1,2}$/;
	if(regAge.exec(age)==null) {
	alert('年龄必须为数字！');
	return false;
	} 
	return true;
	}
</script>  
  </head>
  
  <body>
      <form action="kucundan.do?method=insert" method="post"    onSubmit="return xiuga()"  enctype="multipart/form-data">
    	供应商:<input type="text" name="gys"/><br/>
    	商品名:<input type="text" name="spm"  id="a1"/><br/>
    	颜色:<input type="text" name="color" id="gg"/><br/>
    	尺码:<input type="text" name="size"/><br/>
    	数量:<input type="text" name="shul"  id="a1"/><br/>
    	单价:<input type="text" name="price" id="gg"/><br/>
    	合计:<input type="text" name="heji"/><br/>
    	日期:<input type="text" name="tradedate"  id="a1"/><br/>
    	<input type="submit" value="提交"/>
    </form>
  </body>
</html>
